#ifndef __GRAPHIC_PARTICLE_DISPLAYER__
#define __GRAPHIC_PARTICLE_DISPLAYER__

// .. REFERENCES

#include "primitives.h"
#include "object.h"
#include "ref_to_.h"
#include "text.h"
#include "math_vector_3.h"
class GRAPHIC_PARTICLE_TABLE;
#include "graphic_shader_program.h"
#include "graphic_vertex_buffer.h"
#include "defs.h"
#include "graphic_texture_manager.h"

// .. TYPES

class GRAPHIC_PARTICLE_DISPLAYER :
	public OBJECT
{
	// -- PUBLIC

public :

	// .. TYPES

	DECLARE_REF( GRAPHIC_PARTICLE_DISPLAYER );

	// .. CONSTRUCTORS

	GRAPHIC_PARTICLE_DISPLAYER();

	// .. ACCESSORS

	VOID SetFlags(
		const UINT32 flags
		)
	{
		Flags = flags;
	}

	VOID SetParticleShader( const GRAPHIC_SHADER_PROGRAM::REF shader )
	{
		ParticleShader = shader;
	}

	const GRAPHIC_SHADER_PROGRAM::REF & GetParticleShader() const
	{
		return ParticleShader;
	}

	VOID SetParticleTexture( const GRAPHIC_TEXTURE::REF texture )
	{
		ParticleTexture = texture;
	}

	const GRAPHIC_TEXTURE::REF & GetParticleTexture() const
	{
		return ParticleTexture;
	}

	// .. OPERATIONS

	virtual VOID Initialize(
		const TEXT & particle_texture,
		const GRAPHIC_PARTICLE_TABLE & particle_table
		);

	// ~~

	virtual VOID Render(
		const GRAPHIC_PARTICLE_TABLE & particle_table
		) = 0;

	// ~~

	VOID UpdateConstants(
		const MATH_VECTOR_3 & position
		);


	// -- PROTECTED

protected :

	// .. ATTRIBUTES

	GRAPHIC_SHADER_PROGRAM::REF
		ParticleShader;
	GRAPHIC_TEXTURE::REF
		ParticleTexture;
	COUNT
		CurrentVertexCount,
		MaximumVertexCount;
	UINT32
		Flags;

	// -- PRIVATE

private :

	// .. CONSTRUCTORS

	GRAPHIC_PARTICLE_DISPLAYER(
		const GRAPHIC_PARTICLE_DISPLAYER & other
		);

	// .. OPERATORS

	GRAPHIC_PARTICLE_DISPLAYER & operator=(
		const GRAPHIC_PARTICLE_DISPLAYER & other
		);

};
#endif
